<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of histp</title>
  <meta name="keywords" content="histp">
  <meta name="description" content="HISTP	Histogram estimate of 1-dimensional probability distribution.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../menu.html">Home</a> &gt;  <a href="#">ReBEL-0.2.7</a> &gt; <a href="#">netlab</a> &gt; histp.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../menu.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="menu.html">Index for .\ReBEL-0.2.7\netlab&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>histp
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>HISTP	Histogram estimate of 1-dimensional probability distribution.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function h = histp(x, xmin, xmax, nbins) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">HISTP    Histogram estimate of 1-dimensional probability distribution.

    Description

    HISTP(X, XMIN, XMAX, NBINS) takes a column vector X  of data values
    and generates a normalized histogram plot of the  distribution. The
    histogram has NBINS bins lying in the range XMIN to XMAX.

    H = HISTP(...) returns a vector of patch handles.

    See also
    <a href="demgauss.html" class="code" title="">DEMGAUSS</a></pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="demgauss.html" class="code" title="">demgauss</a>	DEMGAUSS Demonstrate sampling from Gaussian distributions.</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function h = histp(x, xmin, xmax, nbins)</a>
0002 <span class="comment">%HISTP    Histogram estimate of 1-dimensional probability distribution.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">%    Description</span>
0005 <span class="comment">%</span>
0006 <span class="comment">%    HISTP(X, XMIN, XMAX, NBINS) takes a column vector X  of data values</span>
0007 <span class="comment">%    and generates a normalized histogram plot of the  distribution. The</span>
0008 <span class="comment">%    histogram has NBINS bins lying in the range XMIN to XMAX.</span>
0009 <span class="comment">%</span>
0010 <span class="comment">%    H = HISTP(...) returns a vector of patch handles.</span>
0011 <span class="comment">%</span>
0012 <span class="comment">%    See also</span>
0013 <span class="comment">%    DEMGAUSS</span>
0014 <span class="comment">%</span>
0015 
0016 <span class="comment">%    Copyright (c) Ian T Nabney (1996-2001)</span>
0017 
0018 ndata = length(x);
0019 
0020 bins = linspace(xmin, xmax, nbins);
0021 
0022 binwidth = (xmax - xmin)/nbins;
0023 
0024 num = hist(x, bins);
0025 
0026 num = num/(ndata*binwidth);
0027 
0028 h = bar(bins, num, 0.6);
0029</pre></div>
<hr><address>Generated on Tue 26-Sep-2006 10:36:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>